#include "StaticObjects.h"

#include "Physics.h"
#include "Camera.h"
#include "Time.h"
#include "Events\Event.h"

StaticObjects::StaticObjects(void)
{
	this->objectID = "Static Object";
}


StaticObjects::~StaticObjects(void)
{

}

void StaticObjects::Update(float deltaTime)
{

}
void StaticObjects::Render(void) const
{
	GameObject::Render();
}
void StaticObjects::HandleCollision(GameObject& other, CollisionInfo& info)
{
	//Handles the collision for anything that collides with a wall / Floor / Barrier of some sort.
	if(info.Side == CollisionSide::BOTTOM)
		other.SetPosY( other.GetPosY() - (info.Overlap.bottom - info.Overlap.top));
	if(info.Side == CollisionSide::TOP)
		other.SetPosY( other.GetPosY() + (info.Overlap.bottom - info.Overlap.top));
	if(info.Side == CollisionSide::LEFT)
		other.SetPosX( other.GetPosX() + (info.Overlap.right - info.Overlap.left));
	if(info.Side == CollisionSide::RIGHT)
		other.SetPosX( other.GetPosX() - (info.Overlap.right - info.Overlap.left));

	other.SetHitBox(Physics::UpdateColRect(other.GetHitBox(), (int)(other.GetPosX()), (int)(other.GetPosY())));

	other.HandleCollision( *this, info );
}